import { Component, OnInit } from '@angular/core';
import { ActivatedRoute,Router } from '@angular/router';
import { WeibaoService } from "../weibao.service";

@Component({
  selector: 'app-weibao-detail',
  templateUrl: './weibao-detail.component.html',
  styleUrls: ['./weibao-detail.component.css',
    '../../../../../assets/css/timeline.css']
})
export class WeibaoDetailComponent implements OnInit {

  weibaoId:string = '';
  data:any;
  detailData:any;
  constructor(private activeRoute:ActivatedRoute,
              private weibaoService:WeibaoService) { }

  ngOnInit() {
    this.activeRoute.params.subscribe(
      params=> {
        this.weibaoId = this.weibaoService.weibaoId = params['weibaoId'];
        this.weibaoService.getData().subscribe(res => {
          this.data = res.result;
        }, err => console.log(err));

        this.weibaoService.getMans().subscribe(res => {
          this.detailData = res.result;
        }, err => console.log(err));
      }
    );
  }


  cancel(){
    this.weibaoService.cancel();
  }
}
